#include <iostream>
#include "SmartPointer.h"
#include "Exception.h"

using namespace DTLib;
using namespace std;

class Test
{
public:
    Test()
    {
        cout << "Test()" << endl;
    }

    ~Test()
    {
        cout << "~Test()" << endl;
    }
};

void DemoSmartPointer()
{
    SmartPointer<Test> sp = new Test();
    SmartPointer<Test> nsp;

    nsp = sp;

    cout << sp.isNUll() << endl;
    cout << nsp.isNUll() << endl;
}

void DemoArithmeticException()
{
    try
    {
        THROW_EXCEPTION(ArithmeticException, "test");
    }
    catch(const ArithmeticException& e)
    {
        cout << "catch(const ArithmeticException& e)" << endl;
        cout << e.message() << endl;
        cout << e.location() << endl;
    }
}

int main()
{
    // DemoSmartPointer();
    DemoArithmeticException();
    return 0;
}
